#include "map.hpp"
#include "path.hpp"
#include "point.hpp"

#include <iostream>
using namespace std;
using namespace dw;

int main() {
    const string MapDataDir = "./test/MapData/";

    {
        Map maze;
        maze.load(MapDataDir + "maze.txt");
        cout << "Maze: Loaded from file" << endl;
        maze.show();

        Path path;
        Map::State state = maze.getMapState();
        path(state, {0, 0}, {56, 30}, 12, 5);
        showPathOnMap(maze, path);

        maze.show();

        path.simplify(state);
        showPathOnMap(maze, path);
    }

    {
        Map perlin;
        perlin.load(MapDataDir + "perlin.txt");
        cout << "Perlin: Loaded from file" << endl;
        perlin.show();

        Path path;
        Map::State state = perlin.getMapState();
        path(state, {0, 0}, {56, 30});
        showPathOnMap(perlin, path);

        perlin.show();

        path.simplify(state);
        showPathOnMap(perlin, path);

        path.interpolate(1.0);
        showPathOnMap(perlin,path);
    }

    return 0;
}